package com.walker.message;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;

import com.walker.message.constant.ConstanOrder;
import com.walker.message.service.ReceiverService;


@SpringBootApplication
@EnableBinding(ReceiverService.class)
public class MessageApplication {

	public static void main(String[] args) {
		SpringApplication.run(MessageApplication.class, args);
	}
	
	@StreamListener(ConstanOrder.PRODUCT_QUEUE)
	public void onReceiver(byte[] message) {
		System.out.println("spring cloud rabbitMQ receiver message:" + new String(message));
	}
}
